define(function(require, exports, module) {

	var $ = require('jquery');
	
	var $ = require('jquery');
	require('jquery/jquery-file-upload/8.8.5/vendor/jquery.ui.widget.js');
	require('jquery/jquery-file-upload/8.8.5/jquery.iframe-transport.js');
	require('jquery/jquery-file-upload/8.8.5/jquery.fileupload.js');
	
	
	$('#fileupload').fileupload(
			{
				url : $CONFIG.base_url + "/common/attachment/upload/multi",
				dataType : 'json',
				formData : {
					uid : $g_user.id
				},
				acceptFileTypes : /(\.|\/)(gif|png)$/i,
				maxNumberOfFiles : 1,
				maxFileSize : 5000000,
				done : function(e, data) {
					 var result = data.result[0].body ? data.result[0].body.innerHTML : data.result;
					 $.each(result, function(index, file) {
						 var html = '<img src="' + $CONFIG.base_url
							+ '/common/attachment/download/' + file.id
							+ '/250x250"/>';
							$('#file-preview').empty().append(html);
						});
				}
			});
});